package draw;

import edit.DrawShapeContext;

import java.awt.*;
import java.awt.geom.Ellipse2D;

import org.jbox2d.common.Vec2;

/**
 * @author will
 * @date Aug 10, 2008 2:57:03 PM
 */
public class DrawShapeSprite extends DrawSprite {

    public Shape shapeDraw;

    public DrawShapeSprite(DrawShapeContext ed) {
        super(ed);
        shapeDraw = ed.createShape();
    }

    protected void draw(Graphics2D g) {
        Vec2 mouse = layer.getCanvasVector(ed.mousePos);
        Vec2 start = layer.getCanvasVector(startVec);
        shapeDraw = ((DrawShapeContext)ed).setShape(mouse,start);
        g.setStroke(new BasicStroke(1));
        g.setColor(Color.green);
        g.draw(shapeDraw);
    }

}
